﻿<%@ Page Language="C#" MasterPageFile="~/Common/Master/PopupDiv.master" AutoEventWireup="true" Inherits="Calendar_Edit" Title="无标题页" Codebehind="Edit.aspx.cs" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        .style1
        {
            width:80px; text-align:right;
        }
    </style>
    <script type="text/javascript">
    String.prototype.trim  = function(){return this.replace(/^\s+|\s+$/g,"");}
    String.prototype.ltrim = function(){return this.replace(/^\s+/g, "");}
    String.prototype.rtrim = function(){return this.replace(/\s+$/g, "");}
    

    function CompareTime(source, args)
    {
        var txtStartTime = document.getElementById("<%= StartTime.ClientID %>");
        var txtEndTime = document.getElementById("<%= EndTime.ClientID %>");   
        if(txtEndTime.value.trim() == "")
        {
            args.IsValid = true;
            return;
        }
        
        var startTime = GetDateTime(txtStartTime.value);        
        var endTime = GetDateTime(txtEndTime.value);
        
        if(endTime >= startTime)
        {
            args.IsValid = true;
        }
        else
        {
            args.IsValid = false;
        }       
    }
    
    function GetDateTime(strDateTime)
    {
        var strDate = strDateTime.split(" ")[0];
        var strTime = strDateTime.split(" ")[1];       
        
        var dates = strDate.split("-");
        var times = null;
        if(strTime != null)
        {
            times = strTime.split(":");
        }
       
        var date;
        
        if(times != null)
        {
            date = new Date(dates[0],dates[1],dates[2],times[0],times[1],times[2]);
        }
        else
        {
            date = new Date(dates[0],dates[1],dates[2]);
        }
        return date;
    }
   
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <script type="text/javascript" src="../common/Js/calendar.js"></script>
    <asp:Panel ID="pnlMain" runat="server">
    
    <table style="width: 100%">
        <tr>
            <td class="style1">
                <span style="color:Red">*</span>&nbsp;标 题：
            </td>
            <td>
                <asp:TextBox ID="Name" runat="server" CssClass="txt" Width="180px"></asp:TextBox>
                <asp:DropDownList ID="TypeCode" runat="server" Width="77px">
                </asp:DropDownList>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="Name"
                    Display="None" ErrorMessage="请输入标题" SetFocusOnError="True"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="style1">
                <span style="color:Red">*</span>&nbsp;起止时间：
            </td>
            <td>
                <input id="StartTime" runat="server" class="txt" onclick="setday(this,true);" style="width: 118px;
                    cursor: pointer" type="text" /><asp:RequiredFieldValidator 
                    ID="RequiredFieldValidator2" runat="server" ControlToValidate="StartTime" 
                    Display="None" ErrorMessage="请选择开始时间" SetFocusOnError="True"></asp:RequiredFieldValidator>
               
                至 
                <input ID="EndTime" runat="server" class="txt" onclick="setday(this,true);" style="width: 118px;
                    cursor: pointer" type="text" />                              
            </td>
        </tr>
        <tr>
            <td class="style1">
                地 点：
            </td>
            <td>
                <asp:TextBox ID="Addr" runat="server" CssClass="txt" Width="266px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style1">
                <span style="color:Red">*</span>&nbsp;参加人员：
            </td>
            <td>
                <asp:TextBox ID="JoinerNames" runat="server" CssClass="txt" Width="202px"></asp:TextBox>
                <input id="btnBrowse" runat="server" type="button" value="浏览…" />
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="JoinerNames"
                    Display="None" ErrorMessage="请选择参加人员" SetFocusOnError="True"></asp:RequiredFieldValidator>
                <asp:HiddenField ID="JoinerIDs" runat="server" />
            </td>
        </tr>
        <tr>
            <td class="style1">
                其他人员：
            </td>
            <td>
                <asp:TextBox ID="OtherJoiner" runat="server" CssClass="txt" Width="266px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style1" valign="top">
                内 容：
            </td>
            <td style="height:85px;">
                <asp:TextBox ID="Content" runat="server" CssClass="txt" Height="80px" TextMode="MultiLine"
                    Width="267px"></asp:TextBox>
            </td>
        </tr>
    </table>
    </asp:Panel>
    <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True"
        ShowSummary="False" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
    <asp:Button ID="btnSave" runat="server" OnClick="btnSave_Click" Text="保存"/><asp:Button
        ID="btnDelete" runat="server" OnClick="btnDelete_Click" Text="删除" />
</asp:Content>
